<!DOCTYPE html>
<html lang="zh-CN" xmlns:v-bind="http://www.w3.org/1999/xhtml" xmlns:width="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <!-- 上述3个meta标签*必须*放在最前面，任何其他内容都*必须*跟随其后！ -->
    <meta name="viewport"
          content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0,user-scalable=no,minimal-ui">
    <meta name="description" content="">
    <meta name="author" content="">
    <link rel="icon" href="../img/asset-favico.ico">
    <title>预约</title>
    <link rel="stylesheet" href="../css/page-health-order.css"/>
    <link rel="stylesheet" href="../plugins/elementui/index.css"/>
    <script src="../plugins/jquery/dist/jquery.min.js"></script>
    <script src="../plugins/healthmobile.js"></script>
    <script src="../plugins/datapicker/datePicker.js"></script>
    <script src="../plugins/vue/vue.js"></script>
    <script src="../plugins/vue/axios-0.18.0.js"></script>
    <script src="../plugins/elementui/index.js"></script>

</head>
<body data-spy="scroll" data-target="#myNavbar" data-offset="150">
<div class="app" id="app">
    <!-- 页面头部 -->
    <div class="top-header">
        <span class="f-left"><i class="icon-back" onclick="history.go(-1)"></i></span>
        <span class="center">传智健康</span>
        <span class="f-right"><i class="icon-more"></i></span>
    </div>
    <!-- 页面内容 -->
    <div class="contentBox">
        <div class="date" style="height:40px" align="center">
            <label style="font-size: 20px;width: 30%;height:99%">开始时间</label>
            <i class="icon-date" class="startTime"></i>
            <input v-model="startTime" type="text" class="startTime" readonly style="width: 40%;height:60%">
        </div>
        <div class="date" style="height: 40px" align="center">
            <label style="font-size: 20px">结束时间</label>
            <i class="icon-date" class="endTime"></i>
            <input v-model="endTime" type="text" class="endTime" readonly style="width: 40%;height: 60%">
        </div>
        <div class="chaxun" align="center" style="height: 50px">
            <input style="font-size:20px;width: 99%" @click="findByPage()" type="button" value="查询" >
        </div>
        <br/>
    </div>

    <div class="contentBox">
        <div style="color:white;background: #00a0e9" align="center">
            预约记录:
        </div>
        <div class="list-column1">
            <ul class="list">
                <li class="list-item" v-for="setmeal in setmealList">
                    <!--<a href="javascript:void(0);" onclick="GoToNext()"></a>-->
                    <a id="s_order" class="link-page"
                       :href="'order_detail.html?id='+setmeal.sid+'&phoneNumber='+setmeal.phoneNumber+'&orderDate='+setmeal.orderDate">
                        <img class="img-object f-left" :src="'http://qgg5hsnp8.hd-bkt.clouddn.com/'+setmeal.img"
                             style="height: 100px;width: 100px"/>
                        <div class="item-body">
                            <h4 class="ellipsis item-title">体检人 : {{setmeal.memberName}}</h4>
                            <h4 class="ellipsis item-title">体检套餐 : {{setmeal.setmealName}}</h4>
                            <h4 style="color:red">预约日期:{{setmeal.orderDate}}</h4>
                            <h4 style="color:red">到诊状态:{{setmeal.orderStatus}}</h4>
                            <h4 class="">点击查看预约详情</h4>
                        </div>
                    </a>
                </li>
            </ul>
        </div>
    </div>
</div>
<!-- 页面 css js -->
<script src="../plugins/vue/vue.js"></script>
<script src="../plugins/vue/axios-0.18.0.js"></script>
<script src="../plugins/elementui/index.js"></script>
<!--<script src="../js/page-health-order.js"></script>-->
<script>

    /*   var href=$("#s_order").attr('href');
       $("#s_order").attr('href',href+this

   */

    var vue = new Vue({
        el: '#app',
        data: {
            setmealList: [],
            startTime: "",
            endTime: "",

        },
        mounted() {
            axios.get("/login/findOrderByTel.do").then(resp => {

                if (!resp.data.flag) {
                    if (resp.data.message == "当前未登录,请先登录") {
                        this.$message.error("当前未登录,请先登录");
                    } else {
                        this.$message.error(resp.data.message);
                        return;
                    }
                }
                this.setmealList = resp.data.data;

            })

        },
        methods: {
            findByPage() {
                axios.post("/login/findOrderRecord.do?startTime=" + this.startTime + "&endTime=" + this.endTime).then(resp => {

                    if (!resp.data.flag) {
                        this.$message.error(resp.data.message);
                        return;
                    }
                    this.setmealList = resp.data.data;

                })
            }


        }
    });
</script>
<script>
    //日期控件
    var startTime = new datePicker();
    startTime.init({
        'trigger': '.startTime', /*按钮选择器，用于触发弹出插件*/
        'type': 'date', /*模式：date日期；datetime日期时间；time时间；ym年月；*/
        'minDate': getSpecifiedDate(new Date(), -365), /*最小日期*/
        'maxDate': getSpecifiedDate(new Date(), 60), /*最大日期*/
    });

    var endTime = new datePicker();
    endTime.init({
        'trigger': '.endTime', /*按钮选择器，用于触发弹出插件*/
        'type': 'date', /*模式：date日期；datetime日期时间；time时间；ym年月；*/
        'minDate': getSpecifiedDate(new Date(), -60), /*最小日期*/
        'maxDate': getSpecifiedDate(new Date(), 365), /*最大日期*/
    });
</script>
</body>
</html>